# 计算两点联线与水平线的夹角
import math


def calculate_angle(x1, y1, x2, y2):
    # 计算两点之间的差值
    delta_x = x2 - x1
    delta_y = y2 - y1

    # 计算弧度
    radians = math.atan2(delta_y, delta_x)
    # 将弧度转换为角度
    degrees = math.degrees(radians)
    return degrees
